package com.whmskj.xjlhbc.mobile.schedule;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class Classreport {
    private int classindex;
    private String classname;
    private String employee;
    private String startdatetime;
    private String variety;
    private String varietydatetime;
    private double efficiency;
    private double clothlength;
    private int weftcount;
    private int runtime;
    @JsonProperty("stopcount_total")
    private int stopcountTotal;
    @JsonProperty("stoptime_total")
    private int stoptimeTotal;
    @JsonProperty("stopcount_warp")
    private int stopcountWarp;
    @JsonProperty("stoptime_warp")
    private int stoptimeWarp;
    @JsonProperty("stopcount_weft")
    private StopcountWeft stopcountWeft = new StopcountWeft();
    @JsonProperty("stoptime_weft")
    private StopcountWeft stoptimeWeft = new StopcountWeft();
    @JsonProperty("stopcount_earwire")
    private StopcountEarwire stopcountEarwire = new StopcountEarwire();
    @JsonProperty("stoptime_earwire")
    private StopcountEarwire stoptimeEarwire = new StopcountEarwire();
    @JsonProperty("stopcount_slitteredge")
    private StopcountSlitteredge stopcountSlitteredge = new StopcountSlitteredge();
    @JsonProperty("stoptime_slitteredge")
    private StopcountSlitteredge stoptimeSlitteredge = new StopcountSlitteredge();
    @JsonProperty("stopcount_tension")
    private StopcountTension stopcountTension = new StopcountTension();
    @JsonProperty("stoptime_tension")
    private StopcountTension stoptimeTension = new StopcountTension();
    @JsonProperty("stopcount_manual")
    private int stopcountManual;
    @JsonProperty("stoptime_manual")
    private int stoptimeManual;
    @JsonProperty("stopcount_weftfeeder")
    private int stopcountWeftfeeder;
    @JsonProperty("stoptime_weftfeeder")
    private int stoptimeWeftfeeder;
    @JsonProperty("stopcount_piececut")
    private int stopcountPiececut;
    @JsonProperty("stoptime_piececut")
    private int stoptimePiececut;
    @JsonProperty("stopcount_other")
    private int stopcountOther;
    @JsonProperty("stoptime_other")
    private int stoptimeOther;

    public int getStopcountOther() {
        return stopcountEarwire.getTotal() + stopcountSlitteredge.getTotal() +
                stopcountTension.getTotal() + stopcountManual +
                stopcountWeftfeeder + stopcountOther + stopcountPiececut;
    }

    public int getStoptimeOther() {
        return stoptimeEarwire.getTotal() + stoptimeSlitteredge.getTotal() +
                stoptimeTension.getTotal() + stoptimeManual +
                stoptimeWeftfeeder + stoptimeOther + stoptimePiececut;
    }

    public int getStoptimeTotal() {
        return stoptimeWeft.getS().getTotal() + stoptimeWeft.getL().getTotal() + stoptimeWarp +  getStoptimeOther();
    }
}
